package com.kaver.sso.dao.config;


import java.util.Date;

import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;

/**  
* @ClassName: MybatisMetaObjectHandler  
* @Description: 自动填充  
* @author roc  
* @date 2019年4月30日 下午5:17:45  
*    
*/
@Component
public class MybatisMetaObjectHandler implements MetaObjectHandler{
	@Override
	public void insertFill(MetaObject metaObject) {
        metaObject.setValue("createTime", new Date());
        metaObject.setValue("deleted", "0");
	}

	@Override
	public void updateFill(MetaObject metaObject) {
        this.setFieldValByName("updateTime", new Date(),metaObject);
	}

}
